{template 'common/header'}
<ul class="nav nav-tabs">
    <li ><a href="{php echo url('sms/finance/list');}">库款划拨信息列表</a></li>
    {if $id}<li class="active" ><a href="{php echo url('sms/finance/post');}">修改库款划拨信息</a></li>
    {else}
    <li class="active" ><a href="{php echo url('sms/finance/post');}">增加库款划拨信息</a></li>
    {/if}
</ul>
<div class="clearfix">
    <form class="form-horizontal form" action="{php echo url('sms/finance/post');}" method="post" id="form1">
        <input type="hidden" name="id" value="{$row['id']}" />
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">机关代字</label>
            <div class="col-sm-5">
                <select name="cates" class="form-control">
                    {loop $cates $d}
                    <option value="{$d['title']}">{$d['title']}</option>
                    {/loop}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">年份</label>
            <div class="col-sm-5">
                <input type="text" id="fileyear" class="form-control" placeholder="请输入年份" name="fileyear" value="{$row['fileyear']}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">文号</label>
            <div class="col-sm-5">
                <input type="text" id="fileid" class="form-control" name="fileid" value="{$row['fileid']}"  placeholder="请输入文件号"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">总金额</label>
            <div class="col-sm-5">
                <input type="text" id="totalmoney" class="form-control" name="totalmoney" value="{$row['totalmoney']}"  placeholder="请输入总金额"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">拨款金额</label>
            <div class="col-sm-5">
                <input type="text" id="money" class="form-control" name="money" value="{$row['money']}"  placeholder="请输入拨款金额"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
            <div class="col-sm-10">
                <button type="submit" class="btn btn-primary" name="submit" value="提交">提交</button>
                <input type="hidden" name="token" value="{$_W['token']}" />
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    require(['jquery', 'util'], function($, u){
        $("#form1").submit(function(){
            if($("#fileyear").val()) {
                u.message('文件年份为必填项，请返回修改！！', '', 'error');
                return false;
            }
            if($("#fileid").val() == '') {
                u.message('文号为必填项，请返回修改！', '', 'error');
                return false;
            }
            if($("#totalmoney").val() == '') {
                u.message('总金额为必填项，请返回修改！', '', 'error');
                return false;
            }
            if($("#money").val() == '') {
                u.message('拨款金额必填项，请返回修改！', '', 'error');
                return false;
            }
            if($("#remain").val() == '') {
                u.message('剩余金额为必填项，请返回修改！', '', 'error');
                return false;
            }
            if($("#context").val() == '') {
                u.message('识别内容为必填项，请返回修改！', '', 'error');
                return false;
            }
            return true;
        });
    });

</script>
{template 'common/footer'}